{"id":317536,"date":"2021-02-05T15:01:14","date_gmt":"2021-02-05T15:01:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=317536"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=317536","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Azure Functions \u0438 Go"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p><em>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <\/em><a href=\"https:\/\/otus.pw\/mxxsV\/\"><em>\u00abGolang Developer. Professional\u00bb<\/em><\/a><em> \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. <\/p>\n<p>\u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432 \u0438 \u0432\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0435 \u043d\u0430 \u0442\u0435\u043c\u0443 <\/em><a href=\"https:\/\/otus.pw\/CR5I\/\"><em>\u00abGo-\u043a\u0430\u043d\u0430\u043b\u044b \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u0438 \u0432\u043d\u0443\u0442\u0440\u0438\u00bb.<\/em><\/a><em> \u041d\u0430 \u0437\u0430\u043d\u044f\u0442\u0438\u0438 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u0430\u043d\u0430\u043b\u043e\u0432, \u0443\u0437\u043d\u0430\u044e\u0442 \u043f\u0440\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0437\u044b\u043a\u0430.<\/em><\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/793\/108\/ee3\/793108ee3ba1714d3e3a8c50a657f651\" width=\"780\" height=\"439\"><figcaption><\/figcaption><\/figure>\n<hr>\n<h3>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Slack \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 serverless \u0431\u044d\u043a\u0435\u043d\u0434\u0430.<\/h3>\n<p>\u0412\u0435\u0431\u0445\u0443\u043a\u0438 \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f FaaS (\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u0430\u043a \u0443\u0441\u043b\u0443\u0433\u0430) \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0435 \u0433\u0438\u0444\u043a\u0438! \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f serverless \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0435\u0431\u0445\u0443\u043a\u0430, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0435\u0435 \u0432 \u0432\u0438\u0434\u0435 HTTP-\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430. \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/api.slack.com\/start\/overview#apps\"><u>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Slack<\/u><\/a> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 serverless (\u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e) \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/golang.org\/\"><u>Go<\/u><\/a> \u0438 <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-custom-handlers?WT.mc_id=data-9656-abhishgu\"><u>Azure Functions<\/u><\/a>. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 Slack \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043c\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432 Slack.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f <a href=\"https:\/\/get.slack.help\/hc\/en-us\/articles\/204714258-Giphy-for-Slack\"><u>Giphy \u0434\u043b\u044f Slack<\/u><\/a>. \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Giphy \u0434\u043b\u044f Slack \u0432\u044b\u0434\u0430\u0435\u0442 \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0446\u0435\u043b\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0433\u0438\u0444\u043e\u043a. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0443 (\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e) \u0433\u0438\u0444\u043a\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0443 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/developers.giphy.com\/docs\/#operation--gifs-random-get\"><u>Giphy Random API<\/u><\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 <a href=\"https:\/\/azure.microsoft.com\/en-in\/services\/functions\/?WT.mc_id=data-9656-abhishgu\"><u>Azure Functions<\/u><\/a> \u0438 \u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u043e\u0439 Slack.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a5f\/1e2\/890\/a5f1e2890b3966c08c4dafec3e95cf83\" width=\"311\" height=\"342\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0431\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/apps-on-azure\/azure-functions-in-any-language-with-custom-handlers\/ba-p\/1942744\"><strong><u>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u0445 (Custom Handlers)<\/u><\/strong><u> \u0432 Azure Functions<\/u><\/a>;<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u043f\u043e\u0439\u043c\u0435\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u043a\u0443\u043b\u0438\u0441\u0430\u043c\u0438 \u0441 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u043a\u043e\u0434\u0430;<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0443\u0437\u043d\u0430\u0439\u0442\u0435, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Azure Functions \u0438 Slack;<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Slack \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u0435!<\/p>\n<\/li>\n<\/ul>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u0431\u044d\u043a\u0435\u043d\u0434-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 Go (\u043a\u043e\u0434 <a href=\"https:\/\/github.com\/abhirockzz\/serverless-go-slack-app\/\"><u>\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 GitHub<\/u><\/a>). \u0422\u0435, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 Azure Functions \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e Go <em>\u043d\u0435<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u044f\u0437\u044b\u043a\u043e\u0432, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0412\u043e\u0442 \u0433\u0434\u0435 <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-custom-handlers?WT.mc_id=data-9656-abhishgu\"><u>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 (Custom Handlers)<\/u><\/a> \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c!<\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438?<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a &#8212; \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 \u0443\u0437\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\/\u044f\u0437\u044b\u043a\u0430, \u044d\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 HTTP! \u042d\u0442\u043e \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-bindings-http-webhook-trigger?tabs=csharp&amp;WT.mc_id=data-9656-abhishgu\"><u>HTTP-\u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430\u043c\u0438<\/u><\/a> &#8212; \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-triggers-bindings?tabs=csharp&amp;WT.mc_id=data-9656-abhishgu\"><u>\u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438\/\u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430\u043c\u0438 (input\/output bindings)<\/u><\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 (\u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0438\u0436\u0435 \u0431\u044b\u043b\u0430 \u0432\u0437\u044f\u0442\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438)<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f7d\/62c\/3de\/f7d62c3de4cbf512bab53f5804ec47d9\" width=\"855\" height=\"575\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0440\u0438\u0433\u0433\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u0447\u0435\u0440\u0435\u0437 HTTP, \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0442. \u0434.) \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0443\u0437\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (Functions host). \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0442\u0435\u043c, \u0447\u0442\u043e \u0443\u0437\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u0430\u043a \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a: \u043e\u043d \u0432\u044b\u0434\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 (payload) \u043d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 (\u0444\u0443\u043d\u043a\u0446\u0438\u0438) \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 <em>\u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439,<\/em> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440, \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0443\u0437\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<h3>\u041e\u0431\u0437\u043e\u0440<\/h3>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u043a\u043e\u0434\u0430 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043a\u0441\u0442\u0430\u0442\u0438, \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442) \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u0445 \u0434\u0435\u043b\u0430.<\/p>\n<h3>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0422\u0430\u043a \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/p>\n<pre><code>. \u251c\u2500\u2500 cmd \u2502   \u2514\u2500\u2500 main.go \u251c\u2500\u2500 funcy \u2502   \u2514\u2500\u2500 function.json \u251c\u2500\u2500 go.mod \u251c\u2500\u2500 host.json \u2514\u2500\u2500 pkg     \u2514\u2500\u2500 function         \u251c\u2500\u2500 function.go         \u251c\u2500\u2500 giphy.go         \u2514\u2500\u2500 slack.go<\/code><\/pre>\n<ul>\n<li>\n<p>\u0424\u0430\u0439\u043b <code>function.json<\/code> \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 \u043f\u0430\u043f\u043a\u0435, \u0438\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (<a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-custom-handlers?WT.mc_id=data-9656-abhishgu#application-structure\"><u>\u043f\u043e \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e<\/u><\/a>)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"go\">{     \"bindings\": [         {             \"type\": \"httpTrigger\",             \"direction\": \"in\",             \"name\": \"req\",             \"methods\": [                 \"get\",                 \"post\"             ]         },         {             \"type\": \"http\",             \"direction\": \"out\",             \"name\": \"res\"         }     ] }<\/code><\/pre>\n<ul>\n<li>\n<p><code>host.json<\/code> \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u0445\u043e\u0441\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u0443\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u043d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f HTTP. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 <code>customHandler.description.defaultExecutablePath<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e <code>go_funcy<\/code> \u2014 \u044d\u0442\u043e \u0438\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. <code>\"enableForwardingHttpRequest\": true<\/code> \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 HTTP \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"go\">{     \"version\": \"2.0\",     \"extensionBundle\": {         \"id\": \"Microsoft.Azure.Functions.ExtensionBundle\",         \"version\": \"[1.*, 2.0.0)\"     },     \"customHandler\": {         \"description\": {             \"defaultExecutablePath\": \"go_funcy\"         },         \"enableForwardingHttpRequest\": true     },     \"logging\": {         \"logLevel\": {             \"default\": \"Trace\"         }     } }<\/code><\/pre>\n<ul>\n<li>\n<p>\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 <code>cmd<\/code> \u0438 <code>pkg<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Go. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430<\/h3>\n<p><code>cmd\/main.go<\/code> \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \/api\/funcy \u2014 \u044d\u0442\u043e \u0442\u043e\u0442, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0437\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.<\/p>\n<pre><code class=\"go\">func main() {  port, exists := os.LookupEnv(\"FUNCTIONS_CUSTOMHANDLER_PORT\")  if !exists {    port = \"8080\"  }  http.HandleFunc(\"\/api\/funcy\", function.Funcy)  log.Fatal(http.ListenAndServe(\":\"+port, nil)) }<\/code><\/pre>\n<p>\u0412\u0441\u044f \u0433\u0440\u044f\u0437\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <code>function\/function.go<\/code>.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u0438\u0437 Slack) \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0435\u0433\u043e \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <a href=\"https:\/\/api.slack.com\/docs\/verifying-requests-from-slack#a_recipe_for_security\"><u>\u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u0440\u0430\u0432\u0438\u043b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e Slack<\/u><\/a>.<\/p>\n<pre><code class=\"go\">signingSecret := os.Getenv(\"SLACK_SIGNING_SECRET\") \tapiKey := os.Getenv(\"GIPHY_API_KEY\") \tif signingSecret == \"\" || apiKey == \"\" { \t\thttp.Error(w, \"Failed to process request. Please contact the admin\", http.StatusUnauthorized) \t\treturn \t} \tslackTimestamp := r.Header.Get(\"X-Slack-Request-Timestamp\") \tb, err := ioutil.ReadAll(r.Body) \tif err != nil { \t\thttp.Error(w, \"Failed to process request\", http.StatusBadRequest) \t\treturn \t} \tslackSigningBaseString := \"v0:\" + slackTimestamp + \":\" + string(b) \tslackSignature := r.Header.Get(\"X-Slack-Signature\") \tif !matchSignature(slackSignature, signingSecret, slackSigningBaseString) { \t\thttp.Error(w, \"Function was not invoked by Slack\", http.StatusForbidden) \t\treturn \t}<\/code><\/pre>\n<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Slack, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c (Slack).<\/p>\n<pre><code class=\"go\">vals, err := parse(b) \tif err != nil { \t\thttp.Error(w, \"Failed to process request\", http.StatusBadRequest) \t\treturn \t} \tgiphyTag := vals.Get(\"text\")<\/code><\/pre>\n<p>\u0418\u0449\u0435\u043c GIF-\u0444\u0430\u0439\u043b\u044b \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443, \u0432\u044b\u0437\u044b\u0432\u0430\u044f GIPHY REST API<\/p>\n<pre><code class=\"go\">giphyResp, err := http.Get(\"http:\/\/api.giphy.com\/v1\/gifs\/random?tag=\" + giphyTag + \"&amp;api_key=\" + apiKey) \tif err != nil { \t\thttp.Error(w, \"Failed to process request\", http.StatusFailedDependency) \t\treturn \t} \tresp, err := ioutil.ReadAll(giphyResp.Body) \tif err != nil { \t\thttp.Error(w, \"Failed to process request\", http.StatusInternalServerError) \t\treturn \t}<\/code><\/pre>\n<p>\u0410\u043d\u043c\u0430\u0440\u0448\u0430\u043b\u0438\u043c \u043e\u0442\u0432\u0435\u0442, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0447\u0435\u0440\u0435\u0437 GIPHY API, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0432 \u0444\u043e\u0440\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e Slack \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0435\u0433\u043e. \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435!<\/p>\n<pre><code class=\"go\">var gr GiphyResponse json.Unmarshal(resp, &amp;gr) title := gr.Data.Title url := gr.Data.Images.Downsized.URL slackResponse := SlackResponse{Text: slackResponseStaticText, Attachments: []Attachment{{Text: title, ImageURL: url}}} w.Header().Set(\"Content-Type\", \"application\/json\") json.NewEncoder(w).Encode(slackResponse) fmt.Println(\"Sent response to Slack\")<\/code><\/pre>\n<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>matchSignature<\/code>, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0438, \u0438 <code>slack.go<\/code> \u0438 <code>giphy.go<\/code> (\u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>function<\/code>), \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 Go \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (JSON), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438. \u041e\u043d\u0438 \u0441\u044e\u0434\u0430 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435.<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e! \u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u0442\u0435\u043e\u0440\u0438\u044e \u0438 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u0434\u0435\u043b\u043e \u0434\u043e \u043a\u043e\u043d\u0446\u0430! \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c, \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0438\u0441\u044c \u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043d\u0438\u0436\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u0445.<\/p>\n<h3>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/golang.org\/dl\/\"><u>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 Go<\/u><\/a>, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0433\u043e \u0435\u0449\u0435 \u043d\u0435\u0442.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-run-local?tabs=macos%2Ccsharp%2Cbash&amp;WT.mc_id=data-9656-abhishgu#v2\"><u>Azure functions Core Tools<\/u><\/a> \u2014 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (\u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0435 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e).<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><a href=\"https:\/\/slack.com\/create\"><u>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0440\u0435\u0434\u0443 Slack<\/u><\/a>, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043a\u043b\u044e\u0447 API GIPHY \u2014 \u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c GIHPY (\u044d\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e!) \u0438 <a href=\"https:\/\/developers.giphy.com\/dashboard\/?create=true\"><u>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/u><\/a>. \u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0430\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 API.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0433\u0434\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0432\u043e\u0439 \u043a\u043b\u044e\u0447 API GIPHY, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0437\u0436\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f1a\/df2\/f72\/f1adf2f723d1c72a11979bea28756223\" width=\"1600\" height=\"1073\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u0445 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c Azure Function \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Slack \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u044d\u0448-\u043a\u043e\u043c\u0430\u043d\u0434 (Slash command).<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Azure Functions<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-resource-manager\/management\/manage-resource-groups-portal?WT.mc_id=data-9656-abhishgu\"><u>\u0433\u0440\u0443\u043f\u043f\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (Resource Group)<\/u><\/a> \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f-\u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u043f\u043e\u0438\u0441\u043a\u0430 <strong>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 (Function App)<\/strong> \u043d\u0430 \u043f\u043e\u0440\u0442\u0430\u043b\u0435 Azure \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <strong>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c (Add)<\/strong>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e05\/79a\/76b\/e0579a76ba818e25bff37c3d06670e9a\" width=\"1600\" height=\"197\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f: \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c <strong>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a (Custom Handler)<\/strong> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <strong>\u0441\u0442\u0435\u043a\u0430 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (Runtime stack)<\/strong>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/225\/aed\/0ad\/225aed0ad44a78d77d429e26eaa0b76d\" width=\"1600\" height=\"1300\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <strong>\u0425\u043e\u0441\u0442\u0438\u043d\u0433 (Hosting<\/strong> <strong>)<\/strong> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <strong>Linux<\/strong> \u0438 <strong>Consumption (Serverless)<\/strong> \u0434\u043b\u044f <strong>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 (Operating system)<\/strong> \u0438 <strong>\u0422\u0438\u043f \u043f\u043b\u0430\u043d\u0430 (Plan type)<\/strong> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f51\/515\/dba\/f51515dba0311b0f50943743dd40fbd0\" width=\"1600\" height=\"1092\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 <strong>Application Insights<\/strong> (\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f93\/c11\/25a\/f93c1125aa20df4db630b9c622103a62\" width=\"1600\" height=\"713\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <strong>\u0421\u043e\u0437\u0434\u0430\u0442\u044c (Create)<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7f\/717\/c6f\/b7f717c6f85e4acd97b7e63be921752e\" width=\"1129\" height=\"1600\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c-\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/docs.microsoft.com\/azure\/app-service\/overview-hosting-plans?WT.mc_id=data-9656-abhishgu\"><u>App Service plan<\/u><\/a> (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043b\u0430\u043d Consumption\/Serverless)<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><u>\u0410\u043a\u043a\u0430\u0443\u043d\u0442<\/u><a href=\"https:\/\/docs.microsoft.com\/azure\/storage\/common\/storage-account-overview?WT.mc_id=data-9656-abhishgu\"><u> Azure Storage<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-monitor\/app\/app-insights-overview?WT.mc_id=data-9656-abhishgu\"><u>Azure Application Insights<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0439\u0442\u0435 GitHub \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 (<code>build<\/code>) \u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/p>\n<pre><code class=\"go\">git clone https:\/\/github.com\/abhirockzz\/serverless-go-slack-app cd serverless-go-slack-app GOOS=linux go build -o go_funcy cmd\/main.go<\/code><\/pre>\n<\/p>\n<p><code>GOOS=linux<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 Linux, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 Linux \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f-\u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Azure Functions core tools CLI<\/p>\n<pre><code>func azure functionapp publish &lt;enter name of the function app&gt;<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 URL-\u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u2014 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u0430\u0445.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d18\/49f\/26e\/d1849f26e92cf3809bb1c0c966af2876\" width=\"1600\" height=\"264\"><figcaption><\/figcaption><\/figure>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Slack<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0448\u0430\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Slack (\u0441\u043b\u044d\u0448-\u043a\u043e\u043c\u0430\u043d\u0434\u044b) \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u0435:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Slack&nbsp;<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u043b\u044d\u0448-\u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0440\u0435\u0434\u0443<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Slack \u0438 \u0441\u043b\u044d\u0448-\u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/h3>\n<p>\u0412\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 <a href=\"https:\/\/slack.com\/signin\"><u>Slack<\/u><\/a> \u0438 \u043d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 <a href=\"https:\/\/api.slack.com\/apps\/new\"><u>\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Slack.<\/u><\/a><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d2b\/e32\/27c\/d2be3227c716ffdcdbe402c8e774cc44\" width=\"1600\" height=\"665\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 <em>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 (Create New Command)<\/em>, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e <em>\u0441\u043b\u044d\u0448-\u043a\u043e\u043c\u0430\u043d\u0434\u0443 <\/em>\u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u043e\u043b\u0435 <strong>URL-\u0430\u0434\u0440\u0435\u0441\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (Request URL)<\/strong> &#8212; \u044d\u0442\u043e \u043f\u043e\u043b\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b \u0432\u0432\u043e\u0434\u0438\u0442\u0435 HTTP \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435 \u0447\u0442\u043e \u0438\u043d\u043e\u0435, \u043a\u0430\u043a URL-\u0430\u0434\u0440\u0435\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0435, \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <strong>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c (Save)<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c.<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0440\u0435\u0434\u0443<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043b\u044d\u0448-\u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 <em>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f (Basic Information)<\/em> \u0432 \u043c\u0435\u043d\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <em>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0432\u0430\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u0435 (Install your app to your workspace) <\/em>\u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <em>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u0435 (Install App to Workspace)<\/em> \u2014 \u044d\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0440\u0435\u0434\u0443 Slack, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 API Slack. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f <em>\u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (App Credentials)<\/em>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/19b\/c30\/1da\/19bc301da5e944e83524e0594bf90daa\" width=\"1600\" height=\"1220\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c <strong>\u0441\u0435\u043a\u0440\u0435\u0442 (Signing Secret)<\/strong> \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0437\u0436\u0435<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f9a\/7c7\/9f0\/f9a7c79f095da6bb92fe9588debbeea3\" width=\"1584\" height=\"1290\"><figcaption><\/figcaption><\/figure>\n<h3>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443 <\/h3>\n<p>\u2026 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d SLACK<em>SIGNING<\/em>SECRET \u0438 GIPHY<em>API<\/em>KEY \u2014 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/341\/230\/a1d\/341230a1d7eea1e1d0135ee9d51ae3e2\" width=\"1600\" height=\"669\"><figcaption><\/figcaption><\/figure>\n<h2>fun(cy) time!<\/h2>\n<p>\u0412 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u0435 Slack \u0432\u044b\u0437\u043e\u0432\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>\/funcy &lt;search term&gt;<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 <code>\/funcy dog<\/code>. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0433\u0438\u0444\u043a\u0443!<\/p>\n<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9bf\/c6b\/27a\/9bfc6b27a012eaffc372f101e9f0cec9\" width=\"300\" height=\"300\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442: \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>\/funcy<\/code> \u0432 Slack, \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0442\u0435\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 Giphy API \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 GIF \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e (\u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0438\u0434\u0435\u0442 \u043f\u043e \u043f\u043b\u0430\u043d\u0443!).<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c <code>timeout error<\/code> \u0438\u0437 Slack \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 <code>cold start<\/code>, \u043a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0435\u0435 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437. \u042d\u0442\u043e \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u0442\u0435\u043c \u0444\u0430\u043a\u0442\u043e\u043c, \u0447\u0442\u043e <a href=\"https:\/\/api.slack.com\/slash-commands#responding_basic_receipt\"><u>Slack \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 3 \u0441\u0435\u043a\u0443\u043d\u0434<\/u><\/a> \u2014 \u043e\u0442\u0441\u044e\u0434\u0430 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0435 \u043e \u0447\u0435\u043c \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f. \u0412\u0441\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u044d\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u043a\u0443, \u0438 \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435!<\/p>\n<p>\u041d\u0430\u0432\u043e\u0434\u0438\u043c \u043f\u043e\u0440\u044f\u0434\u043e\u043a: \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0435, \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-resource-manager\/management\/delete-resource-group?tabs=azure-powershell&amp;WT.mc_id=data-9656-abhishgu#delete-resource-group\"><u>\u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432,<\/u><\/a> \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0443\u0434\u0430\u043b\u0438\u0442 \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u043d\u0435\u0435 (\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u0444\u0443\u043d\u043a\u0446\u0438\u044f, App Service Plan \u0438 \u0442. \u0434.).<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Go \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 Azure! \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438. \u041f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0441 \u043d\u0430\u043c\u0438 \u0432\u0430\u0448\u0438\u043c\u0438 \u043c\u044b\u0441\u043b\u044f\u043c\u0438.<\/p>\n<hr>\n<blockquote>\n<p><a href=\"https:\/\/otus.pw\/mxxsV\/\"><strong>\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u0443\u0440\u0441\u0435<\/strong><\/a><strong> \u00abGolang Developer. Professional\u00bb. <br \/><\/strong><\/p>\n<p><a href=\"https:\/\/otus.pw\/CR5I\/\"><strong>\u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0432\u0435\u0431\u0438\u043d\u0430\u0440 <\/strong><\/a><strong>\u043f\u043e \u0442\u0435\u043c\u0435 \u00abGo-\u043a\u0430\u043d\u0430\u043b\u044b \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u0438 \u0432\u043d\u0443\u0442\u0440\u0438\u00bb. <\/strong><\/p>\n<\/blockquote>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/541042\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/541042\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p><em>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <\/em><a href=\"https:\/\/otus.pw\/mxxsV\/\"><em>\u00abGolang Developer. Professional\u00bb<\/em><\/a><em> \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. <\/p>\n<p>\u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432 \u0438 \u0432\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0435 \u043d\u0430 \u0442\u0435\u043c\u0443 <\/em><a href=\"https:\/\/otus.pw\/CR5I\/\"><em>\u00abGo-\u043a\u0430\u043d\u0430\u043b\u044b \u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u0438 \u0432\u043d\u0443\u0442\u0440\u0438\u00bb.<\/em><\/a><em> \u041d\u0430 \u0437\u0430\u043d\u044f\u0442\u0438\u0438 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u0430\u043d\u0430\u043b\u043e\u0432, \u0443\u0437\u043d\u0430\u044e\u0442 \u043f\u0440\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0437\u044b\u043a\u0430.<\/em><\/p>\n<\/blockquote>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<hr>\n<h3>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Slack \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 serverless \u0431\u044d\u043a\u0435\u043d\u0434\u0430.<\/h3>\n<p>\u0412\u0435\u0431\u0445\u0443\u043a\u0438 \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f FaaS (\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u0430\u043a \u0443\u0441\u043b\u0443\u0433\u0430) \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0435 \u0433\u0438\u0444\u043a\u0438! \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f serverless \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0435\u0431\u0445\u0443\u043a\u0430, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0435\u0435 \u0432 \u0432\u0438\u0434\u0435 HTTP-\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430. \u0412 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/api.slack.com\/start\/overview#apps\"><u>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Slack<\/u><\/a> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 serverless (\u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e) \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/golang.org\/\"><u>Go<\/u><\/a> \u0438 <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-custom-handlers?WT.mc_id=data-9656-abhishgu\"><u>Azure Functions<\/u><\/a>. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 Slack \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043c\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432 Slack.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f <a href=\"https:\/\/get.slack.help\/hc\/en-us\/articles\/204714258-Giphy-for-Slack\"><u>Giphy \u0434\u043b\u044f Slack<\/u><\/a>. \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Giphy \u0434\u043b\u044f Slack \u0432\u044b\u0434\u0430\u0435\u0442 \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0446\u0435\u043b\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0433\u0438\u0444\u043e\u043a. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432 \u044d\u0442\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0443 (\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e) \u0433\u0438\u0444\u043a\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0443 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/developers.giphy.com\/docs\/#operation--gifs-random-get\"><u>Giphy Random API<\/u><\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 <a href=\"https:\/\/azure.microsoft.com\/en-in\/services\/functions\/?WT.mc_id=data-9656-abhishgu\"><u>Azure Functions<\/u><\/a> \u0438 \u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u043e\u0439 Slack.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0431\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/apps-on-azure\/azure-functions-in-any-language-with-custom-handlers\/ba-p\/1942744\"><strong><u>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u0445 (Custom Handlers)<\/u><\/strong><u> \u0432 Azure Functions<\/u><\/a>;<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u043f\u043e\u0439\u043c\u0435\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u043a\u0443\u043b\u0438\u0441\u0430\u043c\u0438 \u0441 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u043a\u043e\u0434\u0430;<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0443\u0437\u043d\u0430\u0439\u0442\u0435, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Azure Functions \u0438 Slack;<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Slack \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u0435!<\/p>\n<\/li>\n<\/ul>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u0431\u044d\u043a\u0435\u043d\u0434-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 Go (\u043a\u043e\u0434 <a href=\"https:\/\/github.com\/abhirockzz\/serverless-go-slack-app\/\"><u>\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 GitHub<\/u><\/a>). \u0422\u0435, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 Azure Functions \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e Go <em>\u043d\u0435<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u044f\u0437\u044b\u043a\u043e\u0432, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0412\u043e\u0442 \u0433\u0434\u0435 <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-custom-handlers?WT.mc_id=data-9656-abhishgu\"><u>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 (Custom Handlers)<\/u><\/a> \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c!<\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438?<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a &#8212; \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 \u0443\u0437\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\/\u044f\u0437\u044b\u043a\u0430, \u044d\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 HTTP! \u042d\u0442\u043e \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-bindings-http-webhook-trigger?tabs=csharp&amp;WT.mc_id=data-9656-abhishgu\"><u>HTTP-\u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430\u043c\u0438<\/u><\/a> &#8212; \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-triggers-bindings?tabs=csharp&amp;WT.mc_id=data-9656-abhishgu\"><u>\u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438\/\u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430\u043c\u0438 (input\/output bindings)<\/u><\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430 \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 (\u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0438\u0436\u0435 \u0431\u044b\u043b\u0430 \u0432\u0437\u044f\u0442\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438)<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0440\u0438\u0433\u0433\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u0447\u0435\u0440\u0435\u0437 HTTP, \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0442. \u0434.) \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0443\u0437\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (Functions host). \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0442\u0435\u043c, \u0447\u0442\u043e \u0443\u0437\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u0430\u043a \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a: \u043e\u043d \u0432\u044b\u0434\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 (payload) \u043d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 (\u0444\u0443\u043d\u043a\u0446\u0438\u0438) \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 <em>\u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439,<\/em> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440, \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0443\u0437\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<h3>\u041e\u0431\u0437\u043e\u0440<\/h3>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u043a\u043e\u0434\u0430 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043a\u0441\u0442\u0430\u0442\u0438, \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442) \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u0445 \u0434\u0435\u043b\u0430.<\/p>\n<h3>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0422\u0430\u043a \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/p>\n<pre><code>. \u251c\u2500\u2500 cmd \u2502   \u2514\u2500\u2500 main.go \u251c\u2500\u2500 funcy \u2502   \u2514\u2500\u2500 function.json \u251c\u2500\u2500 go.mod \u251c\u2500\u2500 host.json \u2514\u2500\u2500 pkg     \u2514\u2500\u2500 function         \u251c\u2500\u2500 function.go         \u251c\u2500\u2500 giphy.go         \u2514\u2500\u2500 slack.go<\/code><\/pre>\n<ul>\n<li>\n<p>\u0424\u0430\u0439\u043b <code>function.json<\/code> \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 \u043f\u0430\u043f\u043a\u0435, \u0438\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (<a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-custom-handlers?WT.mc_id=data-9656-abhishgu#application-structure\"><u>\u043f\u043e \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e<\/u><\/a>)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"go\">{     \"bindings\": [         {             \"type\": \"httpTrigger\",             \"direction\": \"in\",             \"name\": \"req\",             \"methods\": [                 \"get\",                 \"post\"             ]         },         {             \"type\": \"http\",             \"direction\": \"out\",             \"name\": \"res\"         }     ] }<\/code><\/pre>\n<ul>\n<li>\n<p><code>host.json<\/code> \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u0445\u043e\u0441\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u0443\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u043d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f HTTP. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 <code>customHandler.description.defaultExecutablePath<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e <code>go_funcy<\/code> \u2014 \u044d\u0442\u043e \u0438\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. <code>\"enableForwardingHttpRequest\": true<\/code> \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 HTTP \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"go\">{     \"version\": \"2.0\",     \"extensionBundle\": {         \"id\": \"Microsoft.Azure.Functions.ExtensionBundle\",         \"version\": \"[1.*, 2.0.0)\"     },     \"customHandler\": {         \"description\": {             \"defaultExecutablePath\": \"go_funcy\"         },         \"enableForwardingHttpRequest\": true     },     \"logging\": {         \"logLevel\": {             \"default\": \"Trace\"         }     } }<\/code><\/pre>\n<ul>\n<li>\n<p>\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 <code>cmd<\/code> \u0438 <code>pkg<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Go. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430<\/h3>\n<p><code>cmd\/main.go<\/code> \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \/api\/funcy \u2014 \u044d\u0442\u043e \u0442\u043e\u0442, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0437\u0435\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.<\/p>\n<pre><code class=\"go\">func main() {  port, exists := os.LookupEnv(\"FUNCTIONS_CUSTOMHANDLER_PORT\")  if !exists {    port = \"8080\"  }  http.HandleFunc(\"\/api\/funcy\", function.Funcy)  log.Fatal(http.ListenAndServe(\":\"+port, nil)) }<\/code><\/pre>\n<p>\u0412\u0441\u044f \u0433\u0440\u044f\u0437\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <code>function\/function.go<\/code>.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u0438\u0437 Slack) \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0435\u0433\u043e \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <a href=\"https:\/\/api.slack.com\/docs\/verifying-requests-from-slack#a_recipe_for_security\"><u>\u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u0440\u0430\u0432\u0438\u043b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e Slack<\/u><\/a>.<\/p>\n<pre><code class=\"go\">signingSecret := os.Getenv(\"SLACK_SIGNING_SECRET\") \tapiKey := os.Getenv(\"GIPHY_API_KEY\") \tif signingSecret == \"\" || apiKey == \"\" { \t\thttp.Error(w, \"Failed to process request. Please contact the admin\", http.StatusUnauthorized) \t\treturn \t} \tslackTimestamp := r.Header.Get(\"X-Slack-Request-Timestamp\") \tb, err := ioutil.ReadAll(r.Body) \tif err != nil { \t\thttp.Error(w, \"Failed to process request\", http.StatusBadRequest) \t\treturn \t} \tslackSigningBaseString := \"v0:\" + slackTimestamp + \":\" + string(b) \tslackSignature := r.Header.Get(\"X-Slack-Signature\") \tif !matchSignature(slackSignature, signingSecret, slackSigningBaseString) { \t\thttp.Error(w, \"Function was not invoked by Slack\", http.StatusForbidden) \t\treturn \t}<\/code><\/pre>\n<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Slack, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c (Slack).<\/p>\n<pre><code class=\"go\">vals, err := parse(b) \tif err != nil { \t\thttp.Error(w, \"Failed to process request\", http.StatusBadRequest) \t\treturn \t} \tgiphyTag := vals.Get(\"text\")<\/code><\/pre>\n<p>\u0418\u0449\u0435\u043c GIF-\u0444\u0430\u0439\u043b\u044b \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443, \u0432\u044b\u0437\u044b\u0432\u0430\u044f GIPHY REST API<\/p>\n<pre><code class=\"go\">giphyResp, err := http.Get(\"http:\/\/api.giphy.com\/v1\/gifs\/random?tag=\" + giphyTag + \"&amp;api_key=\" + apiKey) \tif err != nil { \t\thttp.Error(w, \"Failed to process request\", http.StatusFailedDependency) \t\treturn \t} \tresp, err := ioutil.ReadAll(giphyResp.Body) \tif err != nil { \t\thttp.Error(w, \"Failed to process request\", http.StatusInternalServerError) \t\treturn \t}<\/code><\/pre>\n<p>\u0410\u043d\u043c\u0430\u0440\u0448\u0430\u043b\u0438\u043c \u043e\u0442\u0432\u0435\u0442, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0447\u0435\u0440\u0435\u0437 GIPHY API, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0432 \u0444\u043e\u0440\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e Slack \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0435\u0433\u043e. \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435!<\/p>\n<pre><code class=\"go\">var gr GiphyResponse json.Unmarshal(resp, &amp;gr) title := gr.Data.Title url := gr.Data.Images.Downsized.URL slackResponse := SlackResponse{Text: slackResponseStaticText, Attachments: []Attachment{{Text: title, ImageURL: url}}} w.Header().Set(\"Content-Type\", \"application\/json\") json.NewEncoder(w).Encode(slackResponse) fmt.Println(\"Sent response to Slack\")<\/code><\/pre>\n<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>matchSignature<\/code>, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0438, \u0438 <code>slack.go<\/code> \u0438 <code>giphy.go<\/code> (\u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>function<\/code>), \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 Go \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (JSON), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438. \u041e\u043d\u0438 \u0441\u044e\u0434\u0430 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435.<\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e! \u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u0442\u0435\u043e\u0440\u0438\u044e \u0438 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u0434\u0435\u043b\u043e \u0434\u043e \u043a\u043e\u043d\u0446\u0430! \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c, \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0438\u0441\u044c \u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043d\u0438\u0436\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u0445.<\/p>\n<h3>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/golang.org\/dl\/\"><u>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 Go<\/u><\/a>, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0433\u043e \u0435\u0449\u0435 \u043d\u0435\u0442.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-run-local?tabs=macos%2Ccsharp%2Cbash&amp;WT.mc_id=data-9656-abhishgu#v2\"><u>Azure functions Core Tools<\/u><\/a> \u2014 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (\u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0435 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e).<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><a href=\"https:\/\/slack.com\/create\"><u>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0440\u0435\u0434\u0443 Slack<\/u><\/a>, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043a\u043b\u044e\u0447 API GIPHY \u2014 \u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c GIHPY (\u044d\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e!) \u0438 <a href=\"https:\/\/developers.giphy.com\/dashboard\/?create=true\"><u>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/u><\/a>. \u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0430\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 API.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0433\u0434\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0432\u043e\u0439 \u043a\u043b\u044e\u0447 API GIPHY, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0437\u0436\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u0445 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c Azure Function \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Slack \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u044d\u0448-\u043a\u043e\u043c\u0430\u043d\u0434 (Slash command).<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Azure Functions<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-resource-manager\/management\/manage-resource-groups-portal?WT.mc_id=data-9656-abhishgu\"><u>\u0433\u0440\u0443\u043f\u043f\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (Resource Group)<\/u><\/a> \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f-\u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u043f\u043e\u0438\u0441\u043a\u0430 <strong>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 (Function App)<\/strong> \u043d\u0430 \u043f\u043e\u0440\u0442\u0430\u043b\u0435 Azure \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <strong>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c (Add)<\/strong>.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f: \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c <strong>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a (Custom Handler)<\/strong> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <strong>\u0441\u0442\u0435\u043a\u0430 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (Runtime stack)<\/strong>.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <strong>\u0425\u043e\u0441\u0442\u0438\u043d\u0433 (Hosting<\/strong> <strong>)<\/strong> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <strong>Linux<\/strong> \u0438 <strong>Consumption (Serverless)<\/strong> \u0434\u043b\u044f <strong>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 (Operating system)<\/strong> \u0438 <strong>\u0422\u0438\u043f \u043f\u043b\u0430\u043d\u0430 (Plan type)<\/strong> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 <strong>Application Insights<\/strong> (\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438).<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <strong>\u0421\u043e\u0437\u0434\u0430\u0442\u044c (Create)<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c-\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/docs.microsoft.com\/azure\/app-service\/overview-hosting-plans?WT.mc_id=data-9656-abhishgu\"><u>App Service plan<\/u><\/a> (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043b\u0430\u043d Consumption\/Serverless)<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><u>\u0410\u043a\u043a\u0430\u0443\u043d\u0442<\/u><a href=\"https:\/\/docs.microsoft.com\/azure\/storage\/common\/storage-account-overview?WT.mc_id=data-9656-abhishgu\"><u> Azure Storage<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-monitor\/app\/app-insights-overview?WT.mc_id=data-9656-abhishgu\"><u>Azure Application Insights<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0439\u0442\u0435 GitHub \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 (<code>build<\/code>) \u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/p>\n<pre><code class=\"go\">git clone https:\/\/github.com\/abhirockzz\/serverless-go-slack-app cd<\/code><\/pre>\n<\/hr>\n<\/blockquote>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-317536","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=317536"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317536\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}