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

Add hack extension to streamline creation of resources commonly used when hacking #873

Merged
merged 48 commits into from
Sep 5, 2019
Merged

Conversation

GeekTrainer
Copy link

az hack is designed to solve one of the largest gaps we see with students at hackathons, which is creating the various resources commonly used on Azure. Specifically, this extension creates an App Services website, a database of the user's choosing, and optionally a universal key for Cognitive Services.


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

@azuresdkci
Copy link

If this PR is for a new extension or change to an existing extension, use the following to try out the changes in this PR:

docker run -it microsoft/azure-cli:latest
export EXT=<NAME>
pip install --upgrade --target ~/.azure/cliextensions/$EXT "git+https://github.com/GeekTrainer/azure-cli-extensions.git@master#subdirectory=src/$EXT&egg=$EXT"

Copy link

@zikalino zikalino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's ok to be merged, i can't see any major issues here.
you will need to create another pr to actually add extension to the index.
i will also add a few suggestions.

--------

**--name -n**
Name of the application. This will be used to name the Resource Group, App Service Plan, App Service, database server and database. Name must contain only letters and numbers, and start with a letter.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one suggestion here, while resource group must be unique in a subscription, database name for instance must be globally unique, so probably when creating database it would be good to add random prefix.
but this is something that could be done later.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! I'm going to update the code to have the user provide the first 10 characters as a base, and then i'll append 6 random (or something like that)



def hack_up(cmd, name, runtime, database, ai=None):
location = 'westus'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could have default location, but it would be nice to be able to change it. it may happen for some reason that particular resource is unavailable lin "westus" location.

@zikalino zikalino merged commit 6d0b464 into Azure:master Sep 5, 2019
ManuInNZ pushed a commit to ManuInNZ/azure-cli-extensions that referenced this pull request Apr 11, 2020
…when hacking (Azure#873)

* Fixed typo on name of SQL server

* Kickoff of hack extension

* Added support for creating a database

* Added simple build script for testing

* Create database, begin adding app service support

* updated build for full test run

* Added support for creating website and adding app settings

* Working on adding MySQL support

* Added MySQL support

* Adding support for switches and runtimes

* Adding readme files

* STarting readme

* Added metadata

* Adding support for Cognitive Services keys'

* Added support for cogsvcs

* adding CosmosDB support

* Adding support for CosmosDB

* Added suppot for CosmosDB

* Kickoff of hack extension

* Added support for creating a database

* Added simple build script for testing

* Create database, begin adding app service support

* updated build for full test run

* Added support for creating website and adding app settings

* Working on adding MySQL support

* Added MySQL support

* Adding support for switches and runtimes

* Adding readme files

* STarting readme

* Added metadata

* Adding support for Cognitive Services keys'

* Added support for cogsvcs

* adding CosmosDB support

* Adding support for CosmosDB

* Added suppot for CosmosDB

* Added validator and converted params to lower

* Added readme

* Updated readme

* Cleanup for linting

* Linting issues

* Removing personal testing rig

* More linting

* More linting

* Added code owner

* Added licenses

* Fixed comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants