melonrush13 / sqlResourceHelper

Helper functions to create sql Server, sql DB, and delete sql DB using Azure Go SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

services platforms author
mssql
go
joshgav

Azure MSSQL Samples

This package demonstrates how to manage SQL databases and their data.

Contents

  • How to run all samples
  • Management
    • CreateServer
    • CreateDatabase
    • CreateFirewallRules
  • Data plane
    • Open
    • CreateTable
    • Insert
    • Query

How to run all samples

  1. Get this repo and all dependencies.
export PROJECT=github.com/Azure-Samples/azure-sdk-for-go-samples/compute
go get -u $PROJECT
cd ${GOPATH}/src/${PROJECT}
dep ensure
  1. Create an Azure service principal with the [Azure CLI][] command az ad sp create-for-rbac.
  2. Set the following environment variables based on output properties of this command. You can fill in these variables in .env.tpl in this directory and rename that to .env.
EnvVar Value
AZURE_CLIENT_ID service principal/application ID
AZURE_CLIENT_SECRET service principal/application secret
AZURE_TENANT_ID your tenant id
AZURE_SUBSCRIPTION_ID your subscription ID
AZURE_BASE_GROUP_NAME base resource group name
AZURE_LOCATION_DEFAULT location for all resources
  1. Run the sample. go test -v

More information

Please refer to Azure SDK for Go for more information.


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Helper functions to create sql Server, sql DB, and delete sql DB using Azure Go SDK


Languages

Language:Go 100.0%