Skip to content
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

testing onboard with Samples Browser #490

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Includes/cli-clean-up-resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
ms.topic: include
ms.date: 04/29/2022
author: dbradish-microsoft
ms.author: dbradish
manager: barbkess
---

Use the following command to remove the resource group and all resources associated with it using the [az group delete](/cli/azure/group#az-group-delete) command - unless you have an ongoing need for these resources. Some of these resources may take a while to create, as well as to delete.
27 changes: 27 additions & 0 deletions Includes/cli-launch-cloud-shell-sign-in.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
ms.topic: include
ms.date: 01/05/2022
author: dbradish-microsoft
ms.author: dbradish
manager: barbkess
---

### Launch Azure Cloud Shell

The Azure Cloud Shell is a free interactive shell that you can use to run the steps in this article. It has common Azure tools preinstalled and configured to use with your account.

To open the Cloud Shell, just select **Try it** from the upper right corner of a code block. You can also launch Cloud Shell in a separate browser tab by going to [https://shell.azure.com](https://shell.azure.com).

When Cloud Shell opens, verify that **Bash** is selected for your environment. Subsequent sessions will use Azure CLI in a Bash environment, Select **Copy** to copy the blocks of code, paste it into the Cloud Shell, and press **Enter** to run it.

### Sign in to Azure

Cloud Shell is automatically authenticated under the initial account signed-in with. Use the following script to sign in using a different subscription, replacing `<Subscription ID>` with your Azure Subscription ID. [!INCLUDE [quickstarts-free-trial-note](quickstarts-free-trial-note.md)]

```azurecli-interactive
subscription="<subscriptionId>" # add subscription here

az account set -s $subscription # ...or use 'az login'
```

For more information, see [set active subscription](/cli/azure/account#az-account-set) or [log in interactively](/cli/azure/reference-index#az-login)
8 changes: 8 additions & 0 deletions Includes/quickstarts-free-trial-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
author: SyntaxC4
ms.service: cloud-services
ms.topic: include
ms.date: 01/18/2022
ms.author: cfowler
---
If you don't have an [Azure subscription](../articles/guides/developer/azure-developer-guide.md#understanding-accounts-subscriptions-and-billing), create an [Azure free account](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio) before you begin.
91 changes: 49 additions & 42 deletions app-service/README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,66 @@
# Azure Container Registry
---
page_type: sample
languages:
- azurecli
products:
- azure
- azure-cli
- azure-app-service
name: Azure App Service sample scripts
url-fragment:
description: These scripts demonstrate how to work with Azure App Service using the Azure CLI
---
# Azure App Service

## Azure CLI sample scripts

The scripts in this directory demonstrate working with [Azure Container Registry][acr-home] using the [Azure CLI reference commands][azure-cli].
The scripts in this directory demonstrate working with [Azure App Service][aas-home] using the [Azure CLI reference commands][azure-cli].

| Script | Description |
| ------ | ----------- |
|**Backup and restore app**||
|[backup-restore.sh][acr-1]| Creates an App Service app and creates a one-time backup for it, creates a backup schedule for it, and then restores an App Service app from a backup. |
|[backup-restore.sh][aas-1]| Creates an App Service app and creates a one-time backup for it, creates a backup schedule for it, and then restores an App Service app from a backup. |
|**Configure app**||
|[configure-custom-domain-webapp-only.sh][acr-2]| Creates an App Service app and maps a custom domain name to it.|
|[configure-ssl-certificate-webapp-only.sh][acr-3]| Creates an App Service app and binds the TLS/SSL certificate of a custom domain name to it.|
|[configure-ssl-certificate.sh][acr-4]| |
|[configure-custom-domain-webapp-only.sh][aas-2]| Creates an App Service app and maps a custom domain name to it.|
|[configure-ssl-certificate-webapp-only.sh][aas-3]| Creates an App Service app and binds the TLS/SSL certificate of a custom domain name to it.|
|[configure-ssl-certificate.sh][aas-4]| | Creates an App Service app
|**Connect app to resources**||
|[connect-to-documentdb.sh][acr-5]| Creates an App Service app and an Azure Cosmos DB, then adds the Azure Cosmos DB connection details to the app settings. |
|[connect-to-redis.sh][acr-6]| Creates an App Service app and an Azure Cache for Redis, then adds the redis connection details to the app settings.|
|[connect-to-sql.sh][acr-7]| Creates an App Service app and a database in Azure SQL Database, then adds the database connection string to the app settings. |
|[connect-to-storage.sh][acr-8]| Creates an App Service app and a storage account, then adds the storage connection string to the app settings. |
|[connect-to-documentdb.sh][aas-5]| Creates an App Service app and an Azure Cosmos DB, then adds the Azure Cosmos DB connection details to the app settings. |
|[connect-to-redis.sh][aas-6]| Creates an App Service app and an Azure Cache for Redis, then adds the redis connection details to the app settings.|
|[connect-to-sql.sh][aas-7]| Creates an App Service app and a database in Azure SQL Database, then adds the database connection string to the app settings. |
|[connect-to-storage.sh][aas-8]| Creates an App Service app and a storage account, then adds the storage connection string to the app settings. |
|**Create app**||
|[deploy-deployment-slot.sh][acr-9]| Creates an App Service app with a deployment slot for staging code changes.|
|[deploy-ftp.sh][acr-10]| Creates an App Service app and deploys a file to it using FTP.|
|[deploy-github.sh][acr-11]| Creates an App Service app and deploys code from a public GitHub repository. |
|[deploy-linux-docker-webapp-only.sh][acr-12]| Creates an App Service app on Linux and loads a Docker image from Docker Hub.|
|[deploy-vsts-continuous-webapp-only.sh][acr-13]| Creates an App Service app with continuous publishing from a GitHub repository you own. |
|[integrate-with-app-gateway.sh][acr-14]| Creates an App Service app and configures code push into a local Git repository.|
|[deploy-deployment-slot.sh][aas-9]| Creates an App Service app with a deployment slot for staging code changes.|
|[deploy-ftp.sh][aas-10]| Creates an App Service app and deploys a file to it using FTP.|
|[deploy-github.sh][aas-11]| Creates an App Service app and deploys code from a public GitHub repository. |
|[deploy-linux-docker-webapp-only.sh][aas-12]| Creates an App Service app on Linux and loads a Docker image from Docker Hub.|
|[deploy-vsts-continuous-webapp-only.sh][aas-13]| Creates an App Service app with continuous publishing from a GitHub repository you own. |
|[integrate-with-app-gateway.sh][aas-14]| Creates an App Service app and configures code push into a local Git repository.|
|**Monitor app**||
|[monitor-with-logs.sh][acr-15]| Creates an App Service app, enables logging for it, and downloads the logs to your local machine.|
|[monitor-with-logs.sh][aas-15]| Creates an App Service app, enables logging for it, and downloads the logs to your local machine.|
|**Scale app**||
|[scale-geographic.sh][acr-16]| Creates two App Service apps in two different geographical regions and makes them available through a single endpoint using Azure Traffic Manager.|
|[scale-manual.sh][acr-17]| Creates an App Service app and scales it across 2 instances.|




Creates an App Service app and a Private Endpoint
|[scale-geographic.sh][aas-16]| Creates two App Service apps in two different geographical regions and makes them available through a single endpoint using Azure Traffic Manager.|
|[scale-manual.sh][aas-17]| Creates an App Service app and scales it across 2 instances.|

<!-- SCRIPTS -->
[acr-1]: ./backup-one-time-schedule-restore/backup-restore.sh
[acr-2]: ./configure-custom-domain/configure-custom-domain-webapp-only.sh
[acr-3]: ./configure-ssl-certificate/configure-ssl-certificate-webapp-only.sh
[acr-4]: ./configure-ssl-certificate/configure-ssl-certificate.sh
[acr-5]: ./connect-to-documentdb/connect-to-documentdb.sh
[acr-6]: ./connect-to-redis/connect-to-redis.sh
[acr-7]: ./connect-to-sql/connect-to-sql.sh
[acr-8]: ./connect-to-storage/connect-to-storage.sh
[acr-9]: ./deploy-deployment-slot/deploy-deployment-slot.sh
[acr-10]: ./deploy-ftp/deploy-ftp.sh
[acr-11]: ./deploy-github/deploy-github.sh
[acr-12]: ./deploy-linux-docker/deploy-linux-docker-webapp-only.sh
[acr-13]: ./deploy-vsts-continuous/deploy-vsts-continuous-webapp-only.sh
[acr-14]: ./integrate-with-app-gateway/integrate-with-app-gateway.sh
[acr-15]: ./monitor-with-logs/monitor-with-logs.sh
[acr-16]: ./scale-geographic/scale-geographic.sh
[acr-17]: ./scale-manual/scale-manual.sh
[aas-1]: ./backup-one-time-schedule-restore/backup-restore.sh
[aas-2]: ./configure-custom-domain/configure-custom-domain-webapp-only.sh
[aas-3]: ./configure-ssl-certificate/configure-ssl-certificate-webapp-only.sh
[aas-4]: ./configure-ssl-certificate/configure-ssl-certificate.sh
[aas-5]: ./connect-to-documentdb/connect-to-documentdb.sh
[aas-6]: ./connect-to-redis/connect-to-redis.sh
[aas-7]: ./connect-to-sql/connect-to-sql.sh
[aas-8]: ./connect-to-storage/connect-to-storage.sh
[aas-9]: ./deploy-deployment-slot/deploy-deployment-slot.sh
[aas-10]: ./deploy-ftp/deploy-ftp.sh
[aas-11]: ./deploy-github/deploy-github.sh
[aas-12]: ./deploy-linux-docker/deploy-linux-docker-webapp-only.sh
[aas-13]: ./deploy-vsts-continuous/deploy-vsts-continuous-webapp-only.sh
[aas-14]: ./integrate-with-app-gateway/integrate-with-app-gateway.sh
[aas-15]: ./monitor-with-logs/monitor-with-logs.sh
[aas-16]: ./scale-geographic/scale-geographic.sh
[aas-17]: ./scale-manual/scale-manual.sh

<!-- EXTERNAL -->
[acr-home]: https://azure.microsoft.com/services/container-registry/
[aas-home]: https://azure.microsoft.com/services/container-registry/
[azure-cli]: https://learn.microsoft.com/en-us/cli/azure/reference-index
50 changes: 50 additions & 0 deletions app-service/backup-one-time-schedule-restore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
page_type: sample
languages:
- azurecli
products:
- azure
- azure-cli
- azure-app-service
name: Restore an app from a backup using the Azure CLI
url-fragment:
description: Learn how to use the Azure CLI to automate deployment and management of your App Service app. This sample shows how to restore an app from a backup.
---
# Backup and restore a web app from a backup using the Azure CLI

This sample script creates a web app in App Service with its related resources. It then creates a one-time backup for it, and also a scheduled backup for it. Finally, it restores the web app from backup.

[!INCLUDE [quickstarts-free-trial-note](../includes/quickstarts-free-trial-note.md)]

[!INCLUDE [azure-cli-prepare-your-environment.md](~/articles/reusable-content/azure-cli/azure-cli-prepare-your-environment.md)]

## Sample script

[!INCLUDE [cli-launch-cloud-shell-sign-in.md](../includes/cli-launch-cloud-shell-sign-in.md)]

### Run the script

:::code language="azurecli" source="~/azure_cli_scripts/app-service/backup-one-time-schedule-restore/backup-restore.sh" id="FullScript":::

## Clean up resources

[!INCLUDE [cli-clean-up-resources.md](../includes/cli-clean-up-resources.md)]

```azurecli
az group delete --name $resourceGroup
```

## Sample reference

This script uses the following commands. Each command in the table links to command specific documentation.

| Command | Notes |
|---|---|
| [`az webapp config backup list`](/cli/azure/webapp/config/backup#az-webapp-config-backup-list) | Gets a list of backups for a web app. |
| [`az webapp config backup restore`](/cli/azure/webapp/config/backup#az-webapp-config-backup-restore) | Restores a web app from a backup. |

## Next steps

For more information on the Azure CLI, see [Azure CLI documentation](/cli/azure).

Additional App Service CLI script samples can be found in the [Azure App Service documentation](/azure/app-service/samples-cli).
2 changes: 1 addition & 1 deletion azure-front-door/deploy-custom-domain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ The script will:
<!-- link refs -->
[Deploying a static site using AZ CLI]: https://www.davepaquette.com/archive/2020/05/10/deploying-a-static-site-to-azure-using-the-az-cli.aspx
[Add certificates in Key Vault]:https://docs.microsoft.com/en-us/azure/key-vault/certificates/create-certificate-signing-request?tabs=azure-portal#add-certificates-in-key-vault-issued-by-non-partnered-cas
[Host your domain in Azure DNS]:https://docs.microsoft.com/en-us/azure/dns/dns-delegate-domain-azure-dns
[Host your domain in Azure DNS]:https://docs.microsoft.com/en-us/azure/dns/dns-delegate-domain-azure-dns