domingo, 8 de septiembre de 2019

Enable remote publishing with Visual Studio 2019 and Azure VMs



This is a quick guide that covers how to enable remote publishing using Visual Studio 2019 and a Windows Server 2019 Azure Virtual Machine.


  1. Add web server role to the server:
    1. Open Server Manager
    2. Select add roles and features
    3. Web Server(IIS), also install Management tools
  2. Verify that the Management Service is running and configured
    1. Open Services and search for Web Management Service, start if necessary
    2. Open Control Panel and go to Programs and Features
    3. Select Microsoft Web Deploy and click change
    4. Install all missing modules
    5. Go to IIS Manager
    6. Click on Server and then Management Services
    7. Configure port and enable remote connections, leave default port
  3. Enable remote connections in Azure
    1. Login to Azure Admin. Portal
    2. Click on Virtual Machines and pick the desired one
    3. Go to Networking
    4. Add Inbound Port rule for port 8172 (default)
  4. Test remote publish through Visual Studio
    1. Left click on web project and then publish
    2. Use web deploy or VM, it will perform the same operation
    3. In the Server field use the following format: sample.westus2.cloudapp.azure.com:8172
    4. Fill the rest of the fields and test with validate connection
  5. At this point the remote publish should be successful

miércoles, 3 de agosto de 2016

Microsoft OWIN troubleshooting tips for Asp.Net MVC 5- Asp.Net Core

Implementing Identity Auth in an existing Asp.Net MVC project

1.- The default ASP.Net MVC project template from Visual Studio contains the complete implementation for this, create an example project.
2.- Copy the implementation of the following classes:
App_Start folder - IdentityConfig.cs
App_Start folder - Startup.Auth.cs
Models- AccountViewModel.cs
Models- IdentityModels.cs

Root Folder: Startup.cs


3.- Verify the installation and update the references for the following Nuget packages:

Microsoft.Owin
Microsoft.Owin.Security.Cookies
Microsoft.Owin.Security.Oauth
Microsoft.Owin.Security

4.- The connection string configuration from the web.config file:

  <connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-ExampleMVC-20160724094734.mdf;Initial Catalog=aspnet-ExampleMVC-20160724094734;Integrated Security=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

Modify to suit your database environment.

5.- With all the steps followed you should be able to use the Identity API in a new project the same way it works in the default template.

viernes, 27 de mayo de 2016

Grunt Serve "Cannot find where you keep your bower packages" error

To fix this error simply execute the following command

bower install

You should be within the folder of your scaffolded yeoman project.

jueves, 21 de mayo de 2015

Diagnose Oracle Database

  1. Is the listener resolvable? C:\>tnsping IP:port/service(Confirms: the database listener is running on serverside)
  2. Is there a firewall issue? C:\>telnet hostdb port
  3. Can I login? C:\>sqlplus system/pass@MYDB or C:\>sqlplus system/pass@hostname:1521/MYDB(Confirms: The database is open)
  4. Finally, chances of having a successful login with your favorite dev-tool has increased by 100%

To be able to Telnet the host you need to go to control panel, programs and add services/functionalities then telnet client.

When using Windows Telnet if the request is succesful then it won't display anything, if the request fails it will send the failure message.

martes, 5 de mayo de 2015

ODI 1425 Error

This is a common error that occurs with the Oracle Data Integrator Agent.

The solution is to delete and configure again the agent through the ODI console, these are the steps to follow:

1.- Enter the odi console:

http://ServerName:Port/odiconsole

Example:
http://MyServer:8010/odiconsole

2.- You have to right click the agent that is presenting the problem and delete it.

3.- Create the agent again but with the correct informatión this time.

4.- Remember to restart the managed web logic server for the changes to take effect.

Collating Spanish accents in PL-SQL

The following command in PL-SQL is used to remove latin accents from names in Oracle PL-SQL programming language, it is useful when you have to insert words in Spanish that usually contain tittles.


SELECT NAME_USER FROM USERS
WHERE Convert(LOWER(NAME_USER ),'us7ascii')=Convert(LOWER('JESÚS'),'us7ascii')


The previous query will remove the tittles from the data and convert it to lowercase text, for example 'JESÚS' will be converted to 'jesus' without the tittle on the U letter.

The recommended approach is to format the text when you insert it so that you don't have to do it everytime you search for it, in a small database this might not be a problem but when you're searchings millions or billions of records this formatting will massively decrease performance.

You also have to take into consideration whether the information has to have those tittles for presentation purposes for formal documents and reports. In that scenario the best solution would be to add a second column with the raw data and one with the formatted data, the searches should be done against the formatted data column and it should be the one indexed.

martes, 28 de abril de 2015

Linux Command guide 1

Command:
ps -ef |grep odi117

This command shows all the processes currently running for the specified group


Command:

crontab -L

This command shows all the programming for crontab.