다음을 통해 공유


빠른 시작: Bicep을 사용하여 알림 허브 만들기

Azure Notification Hubs는 알림을 모든 백 엔드(클라우드 또는 온-프레미스)에서 모든 플랫폼(iOS, Android, Windows, Kindle 등)으로 보낼 수 있는 사용하기 쉽고 규모가 확장된 푸시 엔진을 제공합니다. 서비스에 대한 자세한 내용은 Azure Notification Hubs란?을 참조하세요.

Bicep은 선언적 구문을 사용하여 Azure 리소스를 배포하는 DSL(도메인 특정 언어)입니다. 간결한 구문, 신뢰할 수 있는 형식 안전성 및 코드 다시 사용에 대한 지원을 제공합니다. Bicep은 Azure에서 코드형 인프라 솔루션에 대한 최고의 제작 환경을 제공합니다.

이 빠른 시작에서는 Bicep을 사용하여 Azure Notification Hubs 네임스페이스 및 해당 네임스페이스 내에 MyHub라는 알림 허브를 만듭니다.

필수 조건

Azure 구독이 없는 경우 시작하기 전에 체험 계정을 만듭니다.

Bicep 파일 검토

이 빠른 시작에서 사용되는 Bicep 파일은 Azure 빠른 시작 템플릿에서 나온 것입니다.

@description('The name of the Notification Hubs namespace.')
param namespaceName string

@description('The location in which the Notification Hubs resources should be deployed.')
param location string = resourceGroup().location

var hubName = 'MyHub'

resource namespace 'Microsoft.NotificationHubs/namespaces@2017-04-01' = {
  name: namespaceName
  location: location
  sku: {
    name: 'Free'
  }
}

resource notificationHub 'Microsoft.NotificationHubs/namespaces/notificationHubs@2017-04-01' = {
  name: hubName
  location: location
  parent: namespace
  properties: {
  }
}

Bicep 파일은 두 개의 Azure 리소스를 만듭니다.

Bicep 파일 배포

  1. Bicep 파일을 main.bicep으로 로컬 컴퓨터에 저장합니다.

  2. Azure CLI 또는 Azure PowerShell을 사용하여 Bicep 파일을 배포합니다.

    az group create --name exampleRG --location eastus
    az deployment group create --resource-group exampleRG --template-file main.bicep --parameters namespaceName=<namespace-name>
    

    참고 항목

    <namespace-name>을 Notifications Hub 네임스페이스의 이름으로 바꿉니다.

    배포가 완료되면 배포에 성공했음을 나타내는 메시지가 표시됩니다.

배포된 리소스 검토

Azure Portal, Azure CLI 또는 Azure PowerShell을 사용하여 리소스 그룹에 배포된 리소스를 나열합니다.

az resource list --resource-group exampleRG

리소스 정리

논리 앱이 더 이상 필요하지 않으면 Azure Portal, Azure CLI 또는 Azure PowerShell을 사용하여 리소스 그룹 및 해당 리소스를 삭제합니다.

az group delete --name exampleRG

다음 단계

Bicep 파일 만들기 프로세스를 안내하는 단계별 자습서는 다음을 참조하세요.