This provides a total solution of generating social media posts for online marketing purpose, using Power Platform as a front-end app and workflow, and Azure Functions as a back-end API app.
- Azure Subscription
- Azure OpenAI Service
- Azure CLI
- Azure Developer CLI
- GitHub CLI
- Microsoft 365 Developer Program
- Power Apps Developer Plan
- Power Platform CLI
-
Fork this repository to your GitHub account,
{{GITHUB_USERNAME}}
. -
Run the commands below to set up a resource names:
# PowerShell $AZURE_ENV_NAME="social$(Get-Random -Min 1000 -Max 9999)" $GITHUB_USERNAME="{{GITHUB_USERNAME}}" # Bash AZURE_ENV_NAME="social$RANDOM" GITHUB_USERNAME="{{GITHUB_USERNAME}}"
-
Run the commands below to provision Azure resources:
azd auth login azd init -e $AZURE_ENV_NAME azd up
You might be asked to input your GitHub username and repository name.
-
Run the commands below to deploy apps to Azure:
az login gh auth login azd pipeline config gh workflow run "Azure Dev" --repo $GITHUB_USERNAME/social-media-assistant
-
To avoid unexpected billing shock, run the commands below to deprovision Azure resources:
azd down --force --purge --no-prompt
Use SocialMediaAssistant.sln
with Visual Studio or Visual Studio Code with the C# Dev Kit extension.
-
Copy
local.settings.sample.json
tolocal.settings.json
. -
Substitute the following values in the
local.settings.json
with the actual values:"OpenAIApi__Endpoint": "https://aoai-{{AZURE_ENV_NAME}}.openai.azure.com/", "OpenAIApi__AuthKey": "{{AOAI_API_KEY}}", "OpenAIApi__DeploymentId": "{{DEPLOYMENT_ID}}",
{{AZURE_ENV_NAME}}
: Azure environment name. It looks likesocial****
where****
is a random number.{{AOAI_API_KEY}}
: API Key of Azure OpenAI Service.{{DEPLOYMENT_ID}}
: Azure OpenAI Service deployment ID. It looks likemodel-gpt35turbo16k
.
- Open Power Automate.
- Import solution from
SocialMediaPostingAssistant.zip
. - Update connection reference links in the
SocialMediaPostingAssistant
flow.