-
Notifications
You must be signed in to change notification settings - Fork 239
Create all Azure resource in the same region of the resource group #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
petetian
wants to merge
42
commits into
Azure-Samples:main
Choose a base branch
from
petetian:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
f51bdee
Add HOME so the script can be run in any folder
petetian 4891990
Merge branch 'Azure-Samples:main' into main
petetian 74c3136
Updated azure-resource.profile and create-azure-resource.sh with new …
petetian 8d42816
Add bash scripts for lab-2
petetian b406e13
add create.mysql.sh
petetian 6212a30
Remove the dependencies of external parameters
petetian 6aeeeba
new module creation
petetian c2fe648
create new module
petetian 3249751
Remove unused variable
petetian 29df268
Update azd json with steps in lab2
petetian fa60784
create docker images for microservices
petetian 7afe183
refactory
petetian 5cf4a91
Refactory
petetian ae3fac9
Refactor: move azure-resource.profile to ../config sharing with other…
petetian 4f8ab79
Refactor: source the config file created by the previous step. Add ap…
petetian 188d693
Refactor
petetian 94ff0ef
Refactor: use common config file
petetian 27b345a
Write created components to config file
petetian 766ca0a
add new module
petetian 901cf04
update .gitignore
petetian 1dfd416
update .gitignore
petetian 87d939a
export LOCATION
petetian 7e2780b
add lab-3
petetian d923a1d
Merge remote-tracking branch 'upstream'
petetian dc6a7ed
create main script as entry point
petetian 058f350
add script for lab 3
petetian f575923
add lab-3; refactor lab-2
petetian b210c9f
bug fixing
petetian fa209e0
bug fixing
petetian a71b2a3
bug fixing
petetian 678f85a
clean up
petetian 5c65673
clean up
petetian 7366333
create lab-3
petetian 293b48b
bug fixing
petetian 77c96eb
add java modules
petetian d2b4001
fix bugs in Java modules
petetian 9e43a81
lab-3 fully working version
petetian 77e68cb
add main script for lab-3
petetian 6b03acf
update chat joke url
petetian 55f730d
create scripts in lab-4
petetian 710a35b
more for lab-4
petetian b891f6f
merge from upstream
petetian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,33 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| source ./azure-resource.profile | ||
| source ./funcs.sh | ||
| export HOME=/workspaces/java-on-aca | ||
|
|
||
| source ./tools/azure-resource.profile | ||
| source ./tools/funcs.sh | ||
|
|
||
| # Resource Group | ||
|
|
||
| # Random regions for MySQL server | ||
| LOCATION=$(random_element australiaeast brazilsouth eastasia eastus2 japaneast southindia swedencentral westus) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are the problems with these regions:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW, I don't think the potential regional latency is matter in this lab environment |
||
|
|
||
| az group create -g $RESOURCE_GROUP -l $LOCATION -o table | ||
|
|
||
| az configure --default group=$RESOURCE_GROUP | ||
|
|
||
| # MySQL server | ||
|
|
||
| # Random regions for MySQL server | ||
| SQL_LOCATION=$(random_element australiaeast brazilsouth eastasia eastus2 japaneast southindia swedencentral westus) | ||
|
|
||
| SQL_ID=$(az mysql flexible-server show --resource-group $RESOURCE_GROUP --name $MYSQL_SERVER_NAME -o tsv --query id 2>/dev/null) | ||
| if [[ -n $SQL_ID ]]; then | ||
| echo -e "${GREEN}INFO:${NC} MySQL server $MYSQL_SERVER_NAME already exists" | ||
| else | ||
| echo -e "${YELLOW}INFO:${NC} Creating MySQL server $MYSQL_SERVER_NAME in region $SQL_LOCATION ..." | ||
| echo -e "${YELLOW}INFO:${NC} Creating MySQL server $MYSQL_SERVER_NAME in region $LOCATION ..." | ||
|
|
||
| az mysql flexible-server create \ | ||
| --admin-user $MYSQL_ADMIN_USERNAME \ | ||
| --admin-password $MYSQL_ADMIN_PASSWORD \ | ||
| --name $MYSQL_SERVER_NAME \ | ||
| --resource-group $RESOURCE_GROUP \ | ||
| --location $SQL_LOCATION \ | ||
| --location $LOCATION \ | ||
| --public-access none \ | ||
| --yes \ | ||
| --output table | ||
|
|
@@ -49,18 +51,16 @@ fi | |
|
|
||
| # Azure OpenAI Service | ||
|
|
||
| AI_LOCATION=$(random_element australiaeast brazilsouth eastus2 japaneast southindia swedencentral westus) | ||
|
|
||
| AI_ID=$(az cognitiveservices account show --resource-group $RESOURCE_GROUP --name $OPEN_AI_SERVICE_NAME -o tsv --query id 2>/dev/null) | ||
| if [[ -n $ACR_ID ]]; then | ||
| echo -e "${GREEN}INFO:${NC} OpenAI instance $OPEN_AI_SERVICE_NAME already exists" | ||
| else | ||
| echo -e "${YELLOW}INFO:${NC} Creating OpenAI instance $OPEN_AI_SERVICE_NAME in region $AI_LOCATION ..." | ||
| echo -e "${YELLOW}INFO:${NC} Creating OpenAI instance $OPEN_AI_SERVICE_NAME in region $LOCATION ..." | ||
|
|
||
| az cognitiveservices account create \ | ||
| --resource-group $RESOURCE_GROUP \ | ||
| --name $OPEN_AI_SERVICE_NAME \ | ||
| --location $AI_LOCATION \ | ||
| --location $LOCATION \ | ||
| --kind OpenAI \ | ||
| --sku s0 \ | ||
| --custom-domain $OPEN_AI_SERVICE_NAME \ | ||
|
|
@@ -122,18 +122,16 @@ fi | |
|
|
||
| # Azure Managed Grafana | ||
|
|
||
| GRAFANA_LOCATION=$(random_element australiaeast brazilsouth centralindia eastasia eastus2 japaneast swedencentral westus) | ||
|
|
||
| GRAFANA_ID=$(az grafana show --name $GRAFANA_NAME --resource-group $RESOURCE_GROUP -o tsv --query id 2>/dev/null) | ||
| if [[ -n $GRAFANA_ID ]]; then | ||
| echo -e "${GREEN}INFO:${NC} Grafana instance $GRAFANA_NAME already exists" | ||
| else | ||
| echo -e "${YELLOW}INFO:${NC} Creating Grafana instance $GRAFANA_NAME in region $GRAFANA_LOCATION ..." | ||
| echo -e "${YELLOW}INFO:${NC} Creating Grafana instance $GRAFANA_NAME in region $LOCATION ..." | ||
|
|
||
| az deployment group create \ | ||
| --resource-group $RESOURCE_GROUP \ | ||
| --template-file ../infra/bicep/modules/grafana/grafana-dashboard.bicep \ | ||
| --parameters grafanaName=$GRAFANA_NAME location=$GRAFANA_LOCATION \ | ||
| --parameters grafanaName=$GRAFANA_NAME location=$LOCATION \ | ||
| --output table | ||
| fi | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.