https://github.com/devkimchi/social-media-assistant
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.
https://github.com/devkimchi/social-media-assistant
Last synced: 4 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/devkimchi/social-media-assistant
- Owner: devkimchi
- License: mit
- Created: 2023-09-25T23:53:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-26T13:53:47.000Z (over 2 years ago)
- Last Synced: 2025-02-15T23:44:10.552Z (over 1 year ago)
- Language: Bicep
- Homepage:
- Size: 1.19 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Social Media Assistant
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.
## Architecture

## Prerequisites
- [Azure Subscription](https://azure.microsoft.com/free?WT.mc_id=dotnet-108200-juyoo)
- [Azure OpenAI Service](https://learn.microsoft.com/azure/ai-services/openai/overview?WT.mc_id=dotnet-108200-juyoo)
- [Azure CLI](https://learn.microsoft.com/cli/azure/what-is-azure-cli?WT.mc_id=dotnet-108200-juyoo)
- [Azure Developer CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/overview?WT.mc_id=dotnet-108200-juyoo)
- [GitHub CLI](https://cli.github.com)
- [Microsoft 365 Developer Program](https://learn.microsoft.com/office/developer-program/microsoft-365-developer-program?WT.mc_id=dotnet-108200-juyoo)
- [Power Apps Developer Plan](https://learn.microsoft.com/power-platform/developer/plan?WT.mc_id=dotnet-108200-juyoo)
- [Power Platform CLI](https://learn.microsoft.com/power-platform/developer/cli/introduction?WT.mc_id=dotnet-108200-juyoo)
## Getting Started
### Provisioning Azure Resources
1. Fork this repository to your GitHub account, `{{GITHUB_USERNAME}}`.
1. Run the commands below to set up a resource names:
```bash
# 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}}"
```
1. Run the commands below to provision Azure resources:
```bash
azd auth login
azd init -e $AZURE_ENV_NAME
azd up
```
> You might be asked to input your GitHub username and repository name.
### Deploying Applications to Azure
1. Run the commands below to deploy apps to Azure:
```bash
az login
gh auth login
azd pipeline config
gh workflow run "Azure Dev" --repo $GITHUB_USERNAME/social-media-assistant
```
### Deprovisioning Azure Resources
1. To avoid unexpected billing shock, run the commands below to deprovision Azure resources:
```bash
azd down --force --purge --no-prompt
```
## Local Development
Use `SocialMediaAssistant.sln` with [Visual Studio](https://visualstudio.microsoft.com/downloads?WT.mc_id=dotnet-108200-juyoo) or [Visual Studio Code](https://code.visualstudio.com?WT.mc_id=dotnet-108200-juyoo) with the [C# Dev Kit extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit&WT.mc_id=dotnet-108200-juyoo).
### `local.settings.json` – `SocialMediaAssistant.ApiApp`
1. Copy `local.settings.sample.json` to `local.settings.json`.
1. Substitute the following values in the `local.settings.json` with the actual values:
```json
"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 like `social****` where `****` is a random number.
- `{{AOAI_API_KEY}}`: API Key of Azure OpenAI Service.
- `{{DEPLOYMENT_ID}}`: Azure OpenAI Service deployment ID. It looks like `model-gpt35turbo16k`.
### Importing Power Automate Solution
1. Open [Power Automate](https://make.powerautomate.com?WT.mc_id=dotnet-108200-juyoo).
1. Import solution from `SocialMediaPostingAssistant.zip`.
1. Update connection reference links in the `SocialMediaPostingAssistant` flow.